#include "Protocol_TCP.h"

CProtocol_TCP::CProtocol_TCP(void)
{
	name = "TCP";
}

CProtocol_TCP::~CProtocol_TCP(void)
{
}

StackUtils::e_Status CProtocol_TCP::Decode( CPacket& packet )
{
	packet.removeElements(0, name.size() + 2);
	packet.removeElements(packet.getBufferContent().size() - (name.size() + 2), name.size() + 2);
	return StackUtils::E_SUCCESS;
}

StackUtils::e_Status CProtocol_TCP::Encode( CPacket& packet )
{
	packet.addFront("[TCP]");
	packet.addBack("[TCP]");
	return StackUtils::E_SUCCESS;
}
